package com.codemonkey.lq.common.util;

import java.lang.reflect.Array;
import java.util.List;

public class ListUtils {
    private ListUtils() {
	throw new Error("Can not instantize ! ! !");
    }

    public static <T> T[] toArray(List<T> list, Class<T> tClass) {
	// 声明并初始化一个T类型的数组
	T[] t = (T[]) Array.newInstance(tClass, list.size());
	for (int i = 0, n = list.size(); i < n; i++) {
	    t[i] = list.get(i);
	}
	
	return t;
    }
}
